package net.wzw;

import org.apache.catalina.connector.Connector;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;

/**
 * @className: UserApplication
 * @author: wzw
 * @date: 2024-08-12 22:13
 * @Version: 1.0
 * @description: User 微服务启动类
 */
@SpringBootApplication
@MapperScan("net.wzw.mapper")
public class UserApplication {

//    @Value("${http.port}")
//    private Integer port;

//    @Bean
//    public ServletWebServerFactory servletContainer() {
//        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
//        // 配置http
//        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//        connector.setPort(port);
//
//        tomcat.addAdditionalTomcatConnectors(connector); // 添加http
//        return tomcat;
//    }

    public static void main(String [] args){
        SpringApplication.run(UserApplication.class, args);
    }
}
